<script>
	import pages from "uni-pages?{\"type\":\"style\"}";
	import {
		getStsToken
	} from './pages/api/index.js'
	let intervalId;
	export default {
		onLaunch: function() {
			if (uni.getStorageSync('ossInfo')) {
				intervalId = setInterval(() => {
					this.getStsToken()
				}, 1000 * 300)
			}else{
					this.getStsToken()
			}
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			getStsToken() {
				getStsToken().then((res) => {
					uni.setStorageSync('ossInfo', JSON.stringify(res.data))
				});
			}
		},
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/uni_modules/uni-scss/index.scss';
	/* #ifndef APP-NVUE */
	@import '@/static/customicons.css';

	// 设置整个项目的背景色
	page {
		background-color: #f5f5f5;
	}

	/* #endif */
	.example-info {
		font-size: 14px;
		color: #333;
		padding: 10px;
	}
</style>